package com.ddf.publics.service;


import com.ddf.publics.entity.QQUserInfo;
import com.ddf.publics.entity.User;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * @ClassName: QQService.java
 * @Description: QQ登陆接口
 * @author: norman
 * @date:  2020-05-05 10:45
 * @version V1.0
 */
public interface QQService {

    /**
     * @description security 手动登录
     * @author norman
     * @date 2020/7/5 15:07
     * @params
     * @return
     */
    void securityLogin(User user, HttpServletRequest request);

    /**
     * @description 获得跳转到qq登录页的url,前台直接连接访问
     * @author norman
     * @date 2020/5/2 16:50
     * @params [session, model]
     * @return java.lang.String
     */
    String getCode();

    /**
     * @description 获取token
     * @author norman
     * @date 2020/5/5 10:48
     * @params [code]
     * @return java.util.Map<java.lang.String,java.lang.Object>
     */
    Map<String, Object> getToken(String code) throws Exception;

    /**
     * @description 刷新token
     * @author norman
     * @date 2020/5/5 10:47
     * @params [qqProperties]
     * @return java.util.Map<java.lang.String,java.lang.Object>
     */
    Map<String,Object> refreshToken(Map<String,Object> qqProperties) throws Exception;

    /**
     * @description 获取OpenId(QQ用户在网站的唯一标识)
     * @author norman
     * @date 2020/5/5 10:48
     * @params [qqProperties]
     * @return java.lang.String
     */
    String getOpenId(Map<String,Object> qqProperties) throws Exception;

    /**
     * @description 获取用户信息
     * @author norman
     * @date 2020/5/5 10:49
     * @params [qqProperties]
     * @return com.momo.entity.QQUserInfo
     */
    QQUserInfo getUserInfo(Map<String,Object> qqProperties) throws Exception;
}
